<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script type="text/javascript">
    function test(){
      document.getElementById("div1").style.backgroundColor="green";
    }
    function test2(){
      document.getElementById("input1").value="";
    }
    function test3(){
      var name = document.getElementById("input1").value;
      if(name.length<6){
        document.getElementById("msg").innerHTML="长度不能低于6位";
      }
    }
    function test4(){
      console.log("hello");
    }
    var divObj = document.getElementById("div1");
    console.log(divObj);
  </script>
</head>
<body onload="test()">
  <input type="button" value="点我" ondblclick="test()"/>
  <div id="div1" style="border:1px solid red;background-color: blue;" onmouseover="test1()" onmouseout="test2()">我是div</div>
  <input type="text" id="input1"  value="zhangsan" onfocus="test2()" onblur="test3()"/><span id="msg"></span>

  <br/>
  <select onchange="test4()">
    <option>本科</option>
    <option>大专</option>
  </select>
</body>
</html>